<!-- HTML header for doxygen 1.9.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>COMMONS-NET: commonsNet.ntp.NtpUtils类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">COMMONS-NET
   </div>
  </td>
    <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('classcommonsNet_1_1ntp_1_1NtpUtils.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="classcommonsNet_1_1ntp_1_1NtpUtils-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">commonsNet.ntp.NtpUtils类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>NtpUtils 是一个常用的 NTP 工具类，提供了多个静态方法来处理 NTP（Network Time Protocol）相关的操作。  
 <a href="classcommonsNet_1_1ntp_1_1NtpUtils.html#details">更多...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ad5e384887ec5b43e98599bf9455f0ba6"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#ad5e384887ec5b43e98599bf9455f0ba6">getHostAddress</a> (address: Int32): String</td></tr>
<tr class="memdesc:ad5e384887ec5b43e98599bf9455f0ba6"><td class="mdescLeft">&#160;</td><td class="mdescRight">将 32 位整数地址转换为 IPv4 地址字符串格式 "%d.%d.%d.%d"。  <br /></td></tr>
<tr class="separator:ad5e384887ec5b43e98599bf9455f0ba6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e5986864a72772302ff5d781ba9b450"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#a5e5986864a72772302ff5d781ba9b450">getModeName</a> (mode: UInt32): String</td></tr>
<tr class="memdesc:a5e5986864a72772302ff5d781ba9b450"><td class="mdescLeft">&#160;</td><td class="mdescRight">返回消息模式类型（RFC 1305）的字符串表示。  <br /></td></tr>
<tr class="separator:a5e5986864a72772302ff5d781ba9b450"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6e3c28357c2531d2412e462c5c7f5ac3"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#a6e3c28357c2531d2412e462c5c7f5ac3">getRefAddress</a> (packet: ?<a class="el" href="classcommonsNet_1_1ntp_1_1NtpV3Packet.html">NtpV3Packet</a>): String</td></tr>
<tr class="memdesc:a6e3c28357c2531d2412e462c5c7f5ac3"><td class="mdescLeft">&#160;</td><td class="mdescRight">将 NTP 数据包的参考标识符作为 IP 地址返回。  <br /></td></tr>
<tr class="separator:a6e3c28357c2531d2412e462c5c7f5ac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba786e7e55cd955a49a9b278766393e4"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#aba786e7e55cd955a49a9b278766393e4">getReferenceClock</a> (message: ?<a class="el" href="classcommonsNet_1_1ntp_1_1NtpV3Packet.html">NtpV3Packet</a>): String</td></tr>
<tr class="memdesc:aba786e7e55cd955a49a9b278766393e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取参考时钟字符串（如 GPS、WWV、LCL）。如果字符串无效（非 ASCII 字符），则返回空字符串 ""。  <br /></td></tr>
<tr class="separator:aba786e7e55cd955a49a9b278766393e4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6cf6034aa483324a487d141d82881411"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#a6cf6034aa483324a487d141d82881411">UInt32toInt32</a> (orinumber: UInt32): Int32</td></tr>
<tr class="memdesc:a6cf6034aa483324a487d141d82881411"><td class="mdescLeft">&#160;</td><td class="mdescRight">将一个 UInt32 类型的整数转换为相同16进制表示的 Int32 类型整数。  <br /></td></tr>
<tr class="separator:a6cf6034aa483324a487d141d82881411"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7a789ad4f2d08679058e79dd9a7ee176"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#a7a789ad4f2d08679058e79dd9a7ee176">UInt64toInt64</a> (orinumber: UInt64): Int64</td></tr>
<tr class="memdesc:a7a789ad4f2d08679058e79dd9a7ee176"><td class="mdescLeft">&#160;</td><td class="mdescRight">将一个 UInt64 类型的整数转换为相同16进制表示的 Int64 类型整数。  <br /></td></tr>
<tr class="separator:a7a789ad4f2d08679058e79dd9a7ee176"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f0233f58df0f2527fc1cb8dc67aef68"><td class="memItemLeft" align="right" valign="top">public static func&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html#a4f0233f58df0f2527fc1cb8dc67aef68">UInt8toInt8</a> (orinumber: UInt8): Int8</td></tr>
<tr class="memdesc:a4f0233f58df0f2527fc1cb8dc67aef68"><td class="mdescLeft">&#160;</td><td class="mdescRight">将一个 UInt8 类型的整数转换为相同16进制表示的 Int8 类型整数。  <br /></td></tr>
<tr class="separator:a4f0233f58df0f2527fc1cb8dc67aef68"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>NtpUtils 是一个常用的 NTP 工具类，提供了多个静态方法来处理 NTP（Network Time Protocol）相关的操作。 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="ad5e384887ec5b43e98599bf9455f0ba6" name="ad5e384887ec5b43e98599bf9455f0ba6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5e384887ec5b43e98599bf9455f0ba6">&#9670;&#160;</a></span>getHostAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.getHostAddress </td>
          <td>(</td>
          <td class="paramname"><em>address</em>:&#160;</td>
          <td class="paramtype">Int32</td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将 32 位整数地址转换为 IPv4 地址字符串格式 "%d.%d.%d.%d"。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">address</td><td>32 位地址 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>IPv4 地址的字符串表示形式 </dd></dl>

</div>
</div>
<a id="a5e5986864a72772302ff5d781ba9b450" name="a5e5986864a72772302ff5d781ba9b450"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e5986864a72772302ff5d781ba9b450">&#9670;&#160;</a></span>getModeName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.getModeName </td>
          <td>(</td>
          <td class="paramname"><em>mode</em>:&#160;</td>
          <td class="paramtype">UInt32</td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>返回消息模式类型（RFC 1305）的字符串表示。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">mode</td><td>模式类型 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>模式名称 </dd></dl>

</div>
</div>
<a id="a6e3c28357c2531d2412e462c5c7f5ac3" name="a6e3c28357c2531d2412e462c5c7f5ac3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6e3c28357c2531d2412e462c5c7f5ac3">&#9670;&#160;</a></span>getRefAddress()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.getRefAddress </td>
          <td>(</td>
          <td class="paramname"><em>packet</em>:&#160;</td>
          <td class="paramtype">?NtpV3Packet</td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将 NTP 数据包的参考标识符作为 IP 地址返回。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">packet</td><td>NTP 数据包 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>数据包参考 ID（作为 IP 地址）的字符串表示形式 "%d.%d.%d.%d" </dd></dl>

</div>
</div>
<a id="aba786e7e55cd955a49a9b278766393e4" name="aba786e7e55cd955a49a9b278766393e4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba786e7e55cd955a49a9b278766393e4">&#9670;&#160;</a></span>getReferenceClock()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.getReferenceClock </td>
          <td>(</td>
          <td class="paramname"><em>message</em>:&#160;</td>
          <td class="paramtype">?NtpV3Packet</td><td>)</td>
          <td>: String </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取参考时钟字符串（如 GPS、WWV、LCL）。如果字符串无效（非 ASCII 字符），则返回空字符串 ""。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">message</td><td>要检查的消息 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>参考时钟字符串 </dd></dl>

</div>
</div>
<a id="a6cf6034aa483324a487d141d82881411" name="a6cf6034aa483324a487d141d82881411"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6cf6034aa483324a487d141d82881411">&#9670;&#160;</a></span>UInt32toInt32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.UInt32toInt32 </td>
          <td>(</td>
          <td class="paramname"><em>orinumber</em>:&#160;</td>
          <td class="paramtype">UInt32</td><td>)</td>
          <td>: Int32 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将一个 UInt32 类型的整数转换为相同16进制表示的 Int32 类型整数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orinumber</td><td>原 UInt32 类型整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的 Int32 类型整数 </dd></dl>

</div>
</div>
<a id="a7a789ad4f2d08679058e79dd9a7ee176" name="a7a789ad4f2d08679058e79dd9a7ee176"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a789ad4f2d08679058e79dd9a7ee176">&#9670;&#160;</a></span>UInt64toInt64()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.UInt64toInt64 </td>
          <td>(</td>
          <td class="paramname"><em>orinumber</em>:&#160;</td>
          <td class="paramtype">UInt64</td><td>)</td>
          <td>: Int64 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将一个 UInt64 类型的整数转换为相同16进制表示的 Int64 类型整数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orinumber</td><td>原 UInt64 类型整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的 Int64 类型整数 </dd></dl>

</div>
</div>
<a id="a4f0233f58df0f2527fc1cb8dc67aef68" name="a4f0233f58df0f2527fc1cb8dc67aef68"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f0233f58df0f2527fc1cb8dc67aef68">&#9670;&#160;</a></span>UInt8toInt8()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">public static func commonsNet.ntp.NtpUtils.UInt8toInt8 </td>
          <td>(</td>
          <td class="paramname"><em>orinumber</em>:&#160;</td>
          <td class="paramtype">UInt8</td><td>)</td>
          <td>: Int8 </td>
        </tr>
      </table>
</div><div class="memdoc">

<p>将一个 UInt8 类型的整数转换为相同16进制表示的 Int8 类型整数。 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">orinumber</td><td>原 UInt8 类型整数 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对应的 Int8 类型整数 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>src/ntp/<a class="el" href="ntp__utils_8cj.html">ntp_utils.cj</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.9.6-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespacecommonsNet.html">commonsNet</a></li><li class="navelem"><a class="el" href="namespacecommonsNet_1_1ntp.html">ntp</a></li><li class="navelem"><a class="el" href="classcommonsNet_1_1ntp_1_1NtpUtils.html">NtpUtils</a></li>
    <li class="footer">制作者 <img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
